<!--
//******************************************************************
//* Copyright (c) 2004 Ford Motor Company. All Rights Reserved.
//*
//*
//* $$Workfile:   partPopup.jsp  $$
//* $$Revision:   1.0  $$
//* $$Author:   JLOPE262  $$
//* $$Date:   Nov 14 2008 08:57:22  $$
//*
//* Description: Description of file goes here
//******************************************************************
-->
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display-el" %>
<%@ taglib uri="ford-arg/tags" prefix="ft" %>

<script language="javascript">
	function findPart() {
		document.PartPopupForm.action = "PartPopupActionFind.do";
		document.PartPopupForm.section.value = "find";
		supplierClassId = document.PartPopupForm.supplierClassId.value;
		supplierCodeId = document.PartPopupForm.supplierCodeId.value;
		if (supplierClassId != '' && supplierCodeId != '') {
			document.PartPopupForm.supplierClass.value = window.opener.document.getElementById(supplierClassId).value;
			document.PartPopupForm.supplierCode.value = window.opener.document.getElementById(supplierCodeId).value;
		}
		document.PartPopupForm.submit();		
	}
	
	function selectPart(partClass, partPrefix, partBase, partSuffix) {
		partClassId = document.PartPopupForm.partClassId.value;
		partPrefixId = document.PartPopupForm.partPrefixId.value;
		partBaseId = document.PartPopupForm.partBaseId.value;
		partSuffixId = document.PartPopupForm.partSuffixId.value;						
		window.opener.document.getElementById(partClassId).value = partClass;
		window.opener.document.getElementById(partPrefixId).value = partPrefix;
		window.opener.document.getElementById(partBaseId).value = partBase;
		window.opener.document.getElementById(partSuffixId).value = partSuffix;				
		window.close();
	}
</script>

<table>
	<tr>
		<td colspan="2"><h2><bean:message key="part.label.title"/></h2></td>
	</tr>
</table>

<html:form action="/PartPopupActionInit">
<html:hidden property="section"/>
<html:hidden property="supplierClass"/>
<html:hidden property="supplierCode"/>
<html:hidden property="supplierClassId"/>
<html:hidden property="supplierCodeId"/>
<html:hidden property="partClassId" />
<html:hidden property="partPrefixId" />
<html:hidden property="partBaseId" />
<html:hidden property="partSuffixId" />

	<bean:define id="partTitle">
		<bean:message key="part.label.tableHeader.part" />
	</bean:define>
	<bean:define id="descriptionTitle">
		<bean:message key="part.label.tableHeader.description" />
	</bean:define>
	
	<table>
		<tr>
			<td class="text_blue_bold align_right">
				<bean:message key="part.label" />
			</td>
			<td class="align_left">
				<html:select property="partClass">
					<html:options collection="partClasses" property="value" labelProperty="label" />
				</html:select>
				&minus;
				<html:text property="partPrefix" maxlength="10" size="10"/>
				&nbsp;
				<html:text property="partBase" maxlength="10" size="10"/>
				&nbsp;
				<html:text property="partSuffix" maxlength="10" size="10"/>
				<html:button property="findP" onclick="findPart();" styleClass="button"><bean:message key="label.find" /></html:button>
			</td>
		</tr>
		<tr>
			<td style="height:15px;" />		
		</tr>		
		<tr>
			<td colspan="100%">
				<ft:saveActivePageNumber />
				<display-el:table 	class="table1" cellpadding="5" uid="part" style="width:450px;"
									name="sessionScope.PartPopupForm.parts"  pagesize="15"
									excludedParams="*" requestURI="PartPopupActionPaginate.do">			
					<display-el:column title="${partTitle}" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right">
						<bean:write name="part" property="eesp01PartClassCodeC"/>
						<bean:write name="part" property="eesp01PartPrefixCodeC"/>&minus;<bean:write name="part" property="eesp01PartBaseCodeC"/>&minus;<bean:write name="part" property="eesp01PartSuffixCodeC"/>
					</display-el:column>
					<display-el:column title="${descriptionTitle}" property="eesp01PartDescriptionX" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right" />
					<display-el:column class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right" ><a href="javascript:selectPart('${part.eesp01PartClassCodeC}','${part.eesp01PartPrefixCodeC}','${part.eesp01PartBaseCodeC}','${part.eesp01PartSuffixCodeC}')"><bean:message key="label.select" /></a></display-el:column>
				</display-el:table>
			</td>
		</tr>
	</table>
</html:form>

&nbsp;